<include file="public:top" />
<!--编辑菜单-->
<fieldset class="layui-elem-field layui-field-title">
    <legend>添加新闻</legend>
</fieldset>
<form class="layui-form layui-form-pane" action="" style="padding:20px;">
	<input type="hidden" value="{$menuid}" name="menuid">
	  <div class="layui-form-item" id="txl_img">
      <label class="layui-form-label">企业图片</label>
      <div class="layui-input-block">
         <button type="button" name="img1" class="layui-btn layui-btn-primary" id="upimg"><i class="layui-icon"></i>只允许图片文件</button>
         <div class="adimg"><img src="" height="36" id="imgval" style="display: none; margin-top: 10px;"></div>
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">名称</label>
      <div class="layui-input-block">
        <input type="text" name="title" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">所在地区</label>
      <div class="layui-input-block">
        <select name=" cate_id">
          <option value="" >请选择</option>
  		<volist name="catelist" id="val" >
  			<option value="{$val.id}" <if condition="$pid eq $val['id']"> selected=""</if>>{$val.name}</option>
  		</volist>
  	   </select>
      </div>
    </div>

   
    <div class="layui-form-item">
      <label class="layui-form-label">电话</label>
      <div class="layui-input-block">
        <input type="number" name="tel" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">联系人</label>
      <div class="layui-input-block">
        <input type="text" name="lianxiren" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">邮箱</label>
      <div class="layui-input-block">
        <input type="text" name="email" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">网址</label>
      <div class="layui-input-block">
        <input type="text" name="url" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">公司地址</label>
      <div class="layui-input-block">
        <input type="text" name="contact" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item" pane>
    <label class="layui-form-label">企业认证</label>
    <div class="layui-input-block">
      <input type="radio" name="renzheng" value="1" title="{:L('yes')}" checked="">
      <input type="radio" name="renzheng" value="0" title="{:L('no')}">
    </div>
  </div>

   
    <input type="hidden" name="img" id="J_img">
  <div class="layui-form-item">
        <button class="layui-btn" lay-submit="" lay-filter="content_edit">立即提交</button>
        <button class="layui-btn layui-btn-primary" onClick="history.go(-1)">返回</button>
  </div>

</form>
<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
//Demo
layui.use(['layer','jquery','form','upload'], function () {
    // 操作对象
    var layer = layui.layer,$ = layui.jquery,form = layui.form, upload = layui.upload;
 
   //上传图片
    upload.render({
    elem: '#upimg'
    ,url: "{:U('txl/ajax_upload_img')}"
    ,field:'img'
    ,acceptMime: 'image/*'
    ,done: function(res, index, upload){
      if (res.status == 1) {
        layer.msg('上传成功',{time:1800});
        var path = "{$img_dir}" + res.info;
        $('#J_img').val(res.info);
        $('#imgval').show().attr('src',path); 
      }else {
        layer.msg('上传失败',{time:1800});
      }
    }
  }); 

  Oper.initUpdate(layui, '企业名录', 'content_edit', 'txl/add');

});
</script>
</body>
</html>